package com.hfstu.framework.web.servlet;


import com.hfstu.framework.util.StringUtil;

public class VerifyCodeUtils {

	/**
	 * 验证验证码是否相同
	 * @param oldCode
	 * @param newCode
	 * @return
	 * @throws VerifyCodeException
	 */
	public static boolean verify(String oldCode, String newCode)
			throws VerifyCodeException {
		boolean verifySuccess = true;
		if (StringUtil.isNullOrEmpty(oldCode)
				|| StringUtil.isNullOrEmpty(newCode)) {
			verifySuccess = false;
		} else {
			if (!oldCode.equalsIgnoreCase(newCode)) {
				verifySuccess = false;
			}
		}
		
		return verifySuccess;
	}
}
